package com.hsh.gaoqianlianmeng.controller;

import com.hsh.gaoqianlianmeng.common.Result;
import com.hsh.gaoqianlianmeng.service.YangBGService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("yangBG")
public class YangBGController {

    @Resource
    private YangBGService yangBGService;

    /**
     * 1.生成CC/HNCC
     * 2.生成处方签数据源
     *
     * @param dateStr
     * @param shop
     * @param password
     * @return
     */
    @GetMapping("/writeAll")
    public Result writeAll(String dateStr, String shop, String password) {
        return yangBGService.writeAll(dateStr, shop, password);
    }

    /**
     * 生成CC/HNCC
     *
     * @param dateStr
     * @param shop
     * @param password
     * @return
     */
    @GetMapping("/writeYangImport")
    public Result writeYangImport(String dateStr, String shop, String password) {
        return yangBGService.writeYangImport(dateStr, shop, password);
    }

    /**
     * 生成处方签数据源
     *
     * @param dateStr
     * @param shop
     * @return
     */
    @GetMapping("/writePrescription")
    public Result writePrescription(String dateStr, String shop) {
        return yangBGService.writePrescription(dateStr, shop);
    }

    /**
     * 生成店铺发货文件
     * @param dateStr
     * @param shop
     * @return
     */
    @GetMapping("/writeShopSend")
    public Result writeShopSend(String dateStr, String shop) {
        return yangBGService.writeShopSend(dateStr, shop);
    }
}
